//
//  AQClassInfo.m
//  Runtime
//
//  Created by jikuan zhang on 2022/6/8.
//  Copyright © 2022 hsgd. All rights reserved.
//

#import "AQClassInfo.h"

@implementation AQClassIvarInfo

-(instancetype)initWithIvar:(Ivar)ivar{
    if (!ivar) return nil;
    self = [super init];
    _ivar = ivar;
    const char *name = ivar_getName(ivar);
    if (name) {
        _name = [NSString stringWithUTF8String:name];
    }
    _offset = ivar_getOffset(ivar);
    const char *typeEncoding = ivar_getTypeEncoding(ivar);
    if (typeEncoding) {
        _typeEncoding = [NSString stringWithUTF8String:typeEncoding];
    }
    
    return self;
}

@end
@implementation AQClassInfo

@end
